home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Apple Shared Library Manager / ASLM Examples / Sample Apps / CSample / Sources / Sample.r < prev    next >
Encoding:
Text File  |  1996-11-19  |  4.1 KB  |  213 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Sample.r
  3.  
  4.     Contains:    Resources needed by the CSample application.
  5.  
  6.     Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10.  
  11. #include "SysTypes.r"
  12. #include "Types.r"
  13.  
  14. #include "Sample.h"
  15.  
  16. resource 'vers' (1) {
  17.     0x01, 0x00, beta, 0x00,
  18.     verUS,
  19.     "1.0ß0",
  20.     "1.0ß0, Copyright \251 Apple Computer, Inc. 1993"
  21. };
  22.  
  23.  
  24. /* we use an MBAR resource to conveniently load all the menus */
  25.  
  26. resource 'MBAR' (rMenuBar, preload) {
  27.     { mApple, mFile, mEdit };        /* three menus (fourth one is added by SLM) */
  28. };
  29.  
  30.  
  31. resource 'MENU' (mApple, preload) {
  32.     mApple, textMenuProc,
  33.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  34.     enabled, apple,
  35.     {
  36.         "About Sample…",
  37.             noicon, nokey, nomark, plain;
  38.         "-",
  39.             noicon, nokey, nomark, plain
  40.     }
  41. };
  42.  
  43. resource 'MENU' (mFile, preload) {
  44.     mFile, textMenuProc,
  45.     MenuItem12,                /* enable Quit only, program enables others */
  46.     enabled, "File",
  47.     {
  48.         "New",
  49.             noicon, "N", nomark, plain;
  50.         "Open",
  51.             noicon, "O", nomark, plain;
  52.         "-",
  53.             noicon, nokey, nomark, plain;
  54.         "Close",
  55.             noicon, "W", nomark, plain;
  56.         "Save",
  57.             noicon, "S", nomark, plain;
  58.         "Save As…",
  59.             noicon, nokey, nomark, plain;
  60.         "Revert",
  61.             noicon, nokey, nomark, plain;
  62.         "-",
  63.             noicon, nokey, nomark, plain;
  64.         "Page Setup…",
  65.             noicon, nokey, nomark, plain;
  66.         "Print…",
  67.             noicon, nokey, nomark, plain;
  68.         "-",
  69.             noicon, nokey, nomark, plain;
  70.         "Quit",
  71.             noicon, "Q", nomark, plain
  72.     }
  73. };
  74.  
  75. resource 'MENU' (mEdit, preload) {
  76.     mEdit, textMenuProc,
  77.     NoItems,                /* disable everything, program does the enabling */
  78.     enabled, "Edit",
  79.      {
  80.         "Undo",
  81.             noicon, "Z", nomark, plain;
  82.         "-",
  83.             noicon, nokey, nomark, plain;
  84.         "Cut",
  85.             noicon, "X", nomark, plain;
  86.         "Copy",
  87.             noicon, "C", nomark, plain;
  88.         "Paste",
  89.             noicon, "V", nomark, plain;
  90.         "Clear",
  91.             noicon, nokey, nomark, plain
  92.     }
  93. };
  94.  
  95. /* this ALRT and DITL are used as an About screen */
  96.  
  97. resource 'ALRT' (rAboutAlert, purgeable) {
  98.     {40, 20, 160, 297},
  99.     rAboutAlert,
  100.     { /* array: 4 elements */
  101.         /* [1] */
  102.         OK, visible, silent,
  103.         /* [2] */
  104.         OK, visible, silent,
  105.         /* [3] */
  106.         OK, visible, silent,
  107.         /* [4] */
  108.         OK, visible, silent
  109.     }
  110. };
  111.  
  112. resource 'DITL' (rAboutAlert, purgeable) {
  113.     { /* array DITLarray: 5 elements */
  114.         /* [1] */
  115.         {88, 185, 108, 265},
  116.         Button {
  117.             enabled,
  118.             "OK"
  119.         },
  120.         /* [2] */
  121.         {8, 8, 24, 214},
  122.         StaticText {
  123.             disabled,
  124.             "Simple Sample (Traffic Light) using Shared Library"
  125.         },
  126.         /* [3] */
  127.         {32, 8, 48, 296},
  128.         StaticText {
  129.             disabled,
  130.             "Copyright © Apple Computer 1993"
  131.         },
  132.         /* [4] */
  133.         {56, 8, 72, 136},
  134.         StaticText {
  135.             disabled,
  136.             "Brought to you by:"
  137.         },
  138.         /* [5] */
  139.         {80, 24, 112, 167},
  140.         StaticText {
  141.             disabled,
  142.             "Macintosh Developer  Technical Support"
  143.         }
  144.     }
  145. };
  146.  
  147.  
  148. /* this ALRT and DITL are used as an error screen */
  149.  
  150. resource 'ALRT' (rUserAlert, purgeable) {
  151.     {40, 20, 120, 260},
  152.     rUserAlert,
  153.     { /* array: 4 elements */
  154.         /* [1] */
  155.         OK, visible, silent,
  156.         /* [2] */
  157.         OK, visible, silent,
  158.         /* [3] */
  159.         OK, visible, silent,
  160.         /* [4] */
  161.         OK, visible, silent
  162.     }
  163. };
  164.  
  165.  
  166. resource 'DITL' (rUserAlert, purgeable) {
  167.     { /* array DITLarray: 3 elements */
  168.         /* [1] */
  169.         {50, 150, 70, 230},
  170.         Button {
  171.             enabled,
  172.             "OK"
  173.         },
  174.         /* [2] */
  175.         {10, 60, 30, 230},
  176.         StaticText {
  177.             disabled,
  178.             "Sample - Error occurred!"
  179.         },
  180.         /* [3] */
  181.         {8, 8, 40, 40},
  182.         Icon {
  183.             disabled,
  184.             2
  185.         }
  186.     }
  187. };
  188.  
  189.  
  190. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  191.  
  192. resource 'SIZE' (-1) {
  193.     dontSaveScreen,
  194.     acceptSuspendResumeEvents,
  195.     enableOptionSwitch,
  196.     canBackground,                /* we can background; we don't currently, but our sleep value */
  197.                                 /* guarantees we don't hog the Mac while we are in the background */
  198.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  199.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  200.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  201.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  202.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  203.     reserved,
  204.     reserved,
  205.     reserved,
  206.     reserved,
  207.     reserved,
  208.     reserved,
  209.     reserved,
  210.     kPrefSize * 1024,
  211.     kMinSize * 1024    
  212. };
  213.